//go:build wireinject

package main

// @Description
// @Author 代码小学生王木木

import (
	"github.com/gin-gonic/gin"
	"github.com/google/wire"
	"guafo/internel/ioc"
	"guafo/internel/service"
	"guafo/internel/web"
	"guafo/internel/web/handler"
	"guafo/internel/web/middlewares/jwtx"
)

var thirdSet = wire.NewSet()

var codeSet = wire.NewSet()

var webSet = wire.NewSet()

func InitWebServer(path string) *gin.Engine {
	wire.Build(
		ioc.InitConfig,
		ioc.InitRedis,
		service.NewCaptchaService,
		handler.NewCodeHandler,
		jwtx.NewRedisJWTHandler,
		web.NewRouter,
		ioc.InitMiddleware,
		ioc.InitGin,
		//wire.Struct(new(gin.Engine), "*"),
	)

	return new(gin.Engine)
}
